package com.xbongbong.pro.formdata.pojo.dto;

import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.pro.formdata.pojo.SaasSpecialParamPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * saas业务解析数据传参对象
 * @author 吴峰
 * @version v1.0
 * @date 2019/2/20 10:12
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class SaasAnalysisDataDTO extends BaseDTO {

    private static final long serialVersionUID = -3500502822182399726L;
    /**
     * 应用id
     */
    @NotNull(message = "{dto.msg.saasAnalysisData.appId.NotNull}")
    private Long appId;

//    @NotNull(message = "菜单id不能为空")
    private Long menuId;

    @NotNull(message = "{dto.msg.saasAnalysisData.formId.NotNull}")
    private Long formId;

    @NotNull(message = "{dto.msg.saasAnalysisData.dataId.NotNull}")
    private Long dataId;

    /**
     * saas标记
     */
    private Integer saasMark;

    /**
     * 业务类型
     */
    private Integer businessType;
    /**
     * 子业务类型
     */
    private Integer subBusinessType;

    private SaasSpecialParamPojo saasSpecialParamPojo;

    private Boolean forProcess;

    private Integer operate;
    /**
     * 来自关联新建
     */
    private Boolean forLinkAdd;

    private Integer fromOuterLink;

    /**
     * 字段容器
     */
    private Map<String, FieldAttrEntity> explainMap;

    public SaasAnalysisDataDTO() {
        forProcess = false;
    }

    /**
     * 用于com.xbongbong.saas.help.FormatProductHelp#formatProduct(com.xbongbong.pro.formdata.pojo.dto.SaasAnalysisDataDTO, com.alibaba.fastjson.JSONObject, java.util.List, boolean)
     * @param corpid
     * @param dataId
     * @param businessType
     * @param forProcess
     * @param operate
     */
    public SaasAnalysisDataDTO(String corpid, Long dataId, Integer businessType, Boolean forProcess, Integer operate) {
        setCorpid(corpid);
        this.dataId = dataId;
        this.businessType = businessType;
        this.forProcess = forProcess;
        this.operate = operate;
    }
}
